home *** CD-ROM | disk | FTP | other *** search
- /* GadTools layout toolkit
- **
- ** Copyright © 1993-1995 by Olaf `Olsen' Barthel
- ** Freely distributable.
- */
-
- #include "gtlayout_global.h"
-
- VOID LIBENT
- LT_ShowWindow(REG(a0) LayoutHandle *handle,REG(a1) BOOL activate)
- {
- if(handle)
- {
- struct Window *window;
- ULONG flags,mask;
-
- window = handle -> Window;
- flags = NULL;
- mask = NULL;
-
- WindowToFront(window);
-
- if(activate)
- {
- // activate the window
-
- ActivateWindow(window);
-
- // wait for the window to become active
-
- flags |= WFLG_WINDOWACTIVE;
- mask |= WFLG_WINDOWACTIVE;
- }
-
- ScreenToFront(window -> WScreen);
-
- if(!handle -> ResizeView && (handle -> Window -> Flags & (WFLG_HASZOOM | WFLG_ZOOMED)) == (WFLG_HASZOOM | WFLG_ZOOMED))
- {
- // make the window full-sized
-
- ZipWindow(window);
-
- // wait for the zoom bit to get cleared
-
- flags &= ~WFLG_ZOOMED;
- mask |= WFLG_ZOOMED;
- }
-
- // wait for the window to change state?
-
- if(mask)
- {
- WORD i;
-
- // wait for the window to change state
-
- for(i = 0 ; i < 300 ; i++)
- {
- if((handle -> Window -> Flags & mask) == flags)
- break;
- else
- WaitTOF();
- }
- }
-
- // make the window visible on the screen by
- // scrolling it into view
-
- LTP_MoveToWindow(handle);
- }
- }
-